using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Features {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) {
            TabsTabGrid.SelectedObject = TabsTab;
            UpdateButtons();
        }
        private void UpdateButtons() {
            prevButton.Enabled = (MainTabControl.Current > 0);
            nextButton.Enabled = (MainTabControl.Current < MainTabControl.Count - 1);
        }

        private void nextButton_Click(object sender, EventArgs e) {
            MainTabControl.Current++;
        }

        private void prevButton_Click(object sender, EventArgs e) {
            MainTabControl.Current--;
        }

        private void closeButton_Click(object sender, EventArgs e) {
            Application.Exit();
        }

        private void MainTabControl_Switched(object sender, EventArgs e) {
            UpdateButtons();
        }

        private void TabsTab_Switched(object sender, EventArgs e) {
            if (TabsTab.Current >= 0)
                EditButton.Enabled = true;
            else
                EditButton.Enabled = false;
        }

        private void timerWorld_Tick(object sender, EventArgs e) {
            sftTabsWorld.TabCollection[0].ImageList = imageListWorld;
            int index = sftTabsWorld.TabCollection[0].ImageIndex;
            if (++index >= 16)
                index = 0;
            sftTabsWorld.TabCollection[0].ImageIndex = index;
        }

        private void helpButton_Click(object sender, EventArgs e) {
            Help.ShowHelp(this, "ms-help://SftTabsNET60/SftTabsNET60/g_usingVS.html", HelpNavigator.TableOfContents);
        }

        private void EditButton_Click(object sender, EventArgs e) {
            TabsTab.TabCollection[TabsTab.Current].Edit();
        }

    }
}